﻿/**************************************************************
* Copyright (C) 2022 www.eipflow.com 孙泽伟版权所有(盗版必究)
*
* 作者: 孙泽伟(QQ 1039318332)
* 创建时间: 2022/01/12 22:40:15
* 文件名: 
* 描述: 
* 
* 修改历史
* 修改人：
* 时间：
* 修改说明：
*
**************************************************************/


using EIP.Base.Models.Entities.System;
using EIP.Common.Controller;
using EIP.Common.Controller.Attribute;
using EIP.Common.Models.Dtos;
using EIP.Wms.Logic;
using EIP.WMS.Models.Dtos;
using Microsoft.AspNetCore.Mvc;

namespace EIP.Wms.Controller
{
    /// <summary>
    /// 控制器
    /// </summary>
    public class WmsTestController : BaseController
    {
        #region 构造函数
        private readonly IWmsTestLogic _WmsTestLogic;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="WmsTestLogic"></param>
        public WmsTestController(IWmsTestLogic WmsTestLogic)
        {
            _WmsTestLogic = WmsTestLogic;
        }
        #endregion

        #region 方法

        /// <summary>
        /// 读取所有信息
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        [CreateBy("孙泽伟")]
        [Remark("WMSTest-方法-列表-读取所有信息", RemarkFrom.Wms)]
        [Route("/wms/test/list")]
        public async Task<ActionResult> Find(WmsTestFindInput input)
        {
            return JsonForGridPaging(await _WmsTestLogic.Find(input));
        }

        /// <summary>
        /// 根据id获取
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [CreateBy("孙泽伟")]
        [Remark("WMSTest-方法-根据id获取", RemarkFrom.Wms)]
        [Route("/wms/test/{id}")]
        public async Task<ActionResult> FindById([FromRoute]IdInput input)
        {
            return Ok(await _WmsTestLogic.FindById(input));
        }

        /// <summary>
        /// 保存配置信息值
        /// </summary>
        /// <param name="button">配置项信息</param>
        /// <returns></returns>
        [HttpPost]
        [CreateBy("孙泽伟")]
        [Remark("WMSTest-方法-新增/编辑-保存", RemarkFrom.Wms)]
        [Route("/wms/test")]
        public async Task<ActionResult> Save( WmsTest button)
        {
            return Ok(await _WmsTestLogic.Save(button));
        }

        /// <summary>
        /// 删除配置信息
        /// </summary>
        /// <param name="input">配置项主键Id</param>
        /// <returns></returns>
        [HttpPost]
        [CreateBy("孙泽伟")]
        [Remark("WMSTest-方法-列表-删除", RemarkFrom.Wms)]
        [Route("/wms/test/delete")]
        public async Task<ActionResult> Delete( IdInput<string> input)
        {
            return Ok(await _WmsTestLogic.Delete(input));
        }
        #endregion
    }
}